package java8.stream.demo02buildstream;

import java.time.Instant;
import java.util.Random;
import java.util.function.Supplier;

/**
 * @author ChangLiang
 * @date 2020/4/22
 */
public class RandomObjSupplier implements Supplier<Obj> {

    private int index = 0;
    private Random random = new Random(Instant.now().toEpochMilli());

    @Override
    public Obj get() {
        index = random.nextInt(100);
        return new Obj(index, "Name->" + index);
    }
}
